﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SonCa.SocialNetwork.Accounts.IPresenters;
using System.ComponentModel.Composition;
using Core.BusinessLogic.Interfaces;
using Core.Common;
using Core.DataAccess;

namespace SonCa.SocialNetwork.Accounts.Presenters
{
    public class LoginPresenter
    {
        private ILoginPresenter _view;
        [Import]
        private IAccountService _accountServcie;

        public void Init(ILoginPresenter view)
        {
            _view = view;
            MEFManager.Compose(this);
        }

        public void Login(string username, string password)
        {
            string message = _accountServcie.Login(username, password);
            _view.DisplayMessage(message);
        }        
    }
}